\hypertarget{class_xml_data}{\section{Xml\+Data类 参考}
\label{class_xml_data}\index{Xml\+Data@{Xml\+Data}}
}


X\+M\+L数据类  




{\ttfamily \#include $<$Xml\+Data.\+h$>$}

\subsection*{Public 成员函数}
\begin{DoxyCompactItemize}
\item 
\hyperlink{class_xml_data_a53c5142aa69579a5c73a772b9758d928}{Xml\+Data} ()
\begin{DoxyCompactList}\small\item\em Xml\+Data构造函数 \end{DoxyCompactList}\item 
\hyperlink{class_xml_data_a847aa0938ae7466fbcface61c883ecd8}{$\sim$\+Xml\+Data} ()
\begin{DoxyCompactList}\small\item\em Xml\+Data析构函数 \end{DoxyCompactList}\item 
bool \hyperlink{class_xml_data_a6917a040669cf9c048eedcf27ee20f7c}{init\+With\+Data\+String} (const std\+::string \&content)
\begin{DoxyCompactList}\small\item\em 读取\+X\+M\+L字符串进行初始化 \end{DoxyCompactList}\item 
bool \hyperlink{class_xml_data_a257fec6d724f2eca7b6357d528144b35}{init\+With\+Content\+Of\+File} (const std\+::string \&file\+Name)
\begin{DoxyCompactList}\small\item\em 读取\+X\+M\+L文件内容进行初始化 \end{DoxyCompactList}\item 
bool \hyperlink{class_xml_data_a463079e4851be2d59a30ab83b8f85710}{save\+As\+File} (const std\+::string \&file\+Name)
\begin{DoxyCompactList}\small\item\em 写入\+J\+S\+O\+N数据到文件中 \end{DoxyCompactList}\item 
std\+::string \hyperlink{class_xml_data_aaccbe1677c6cfc0b0cfa57d7227db266}{serialize} ()
\begin{DoxyCompactList}\small\item\em 串行化\+Xml\+Data成字符串 \end{DoxyCompactList}\item 
bool \hyperlink{class_xml_data_a1b150f9e0b899ecd186767a8a82c4b2b}{add\+Sub\+Node} (const std\+::string \&node\+Name, const int \&value)
\begin{DoxyCompactList}\small\item\em 增加整数型子结点 \end{DoxyCompactList}\item 
bool \hyperlink{class_xml_data_a797602366bea8aa360d66c194965c543}{add\+Sub\+Node} (const std\+::string \&node\+Name, const double \&value)
\begin{DoxyCompactList}\small\item\em 增加浮点型子结点 \end{DoxyCompactList}\item 
bool \hyperlink{class_xml_data_a6f3dd5e677198c44e55665b1aca2200b}{add\+Sub\+Node} (const std\+::string \&node\+Name, const std\+::string value=\char`\"{}\char`\"{})
\begin{DoxyCompactList}\small\item\em 增加字符串型子结点 \end{DoxyCompactList}\item 
\hyperlink{class_xml_node}{Xml\+Node} \hyperlink{class_xml_data_a116459823c48877fc8263723d320e7f1}{operator\mbox{[}$\,$\mbox{]}} (std\+::string name)
\begin{DoxyCompactList}\small\item\em 根据名称获取子结点 \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{详细描述}
X\+M\+L数据类 

\subsection{构造及析构函数说明}
\hypertarget{class_xml_data_a53c5142aa69579a5c73a772b9758d928}{\index{Xml\+Data@{Xml\+Data}!Xml\+Data@{Xml\+Data}}
\index{Xml\+Data@{Xml\+Data}!Xml\+Data@{Xml\+Data}}
\subsubsection[{Xml\+Data}]{\setlength{\rightskip}{0pt plus 5cm}Xml\+Data\+::\+Xml\+Data (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{class_xml_data_a53c5142aa69579a5c73a772b9758d928}


Xml\+Data构造函数 


\begin{DoxyParams}{参数}
{\em none} & \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
none 
\end{DoxyReturn}
\begin{DoxyNote}{注解}
Xml\+Data代表一份\+Xml数据文档 
\end{DoxyNote}
\hypertarget{class_xml_data_a847aa0938ae7466fbcface61c883ecd8}{\index{Xml\+Data@{Xml\+Data}!````~Xml\+Data@{$\sim$\+Xml\+Data}}
\index{````~Xml\+Data@{$\sim$\+Xml\+Data}!Xml\+Data@{Xml\+Data}}
\subsubsection[{$\sim$\+Xml\+Data}]{\setlength{\rightskip}{0pt plus 5cm}Xml\+Data\+::$\sim$\+Xml\+Data (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{class_xml_data_a847aa0938ae7466fbcface61c883ecd8}


Xml\+Data析构函数 


\begin{DoxyParams}{参数}
{\em none} & \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
none 
\end{DoxyReturn}
\begin{DoxyNote}{注解}
none 
\end{DoxyNote}


\subsection{成员函数说明}
\hypertarget{class_xml_data_a1b150f9e0b899ecd186767a8a82c4b2b}{\index{Xml\+Data@{Xml\+Data}!add\+Sub\+Node@{add\+Sub\+Node}}
\index{add\+Sub\+Node@{add\+Sub\+Node}!Xml\+Data@{Xml\+Data}}
\subsubsection[{add\+Sub\+Node}]{\setlength{\rightskip}{0pt plus 5cm}bool Xml\+Data\+::add\+Sub\+Node (
\begin{DoxyParamCaption}
\item[{const std\+::string \&}]{node\+Name, }
\item[{const int \&}]{value}
\end{DoxyParamCaption}
)}}\label{class_xml_data_a1b150f9e0b899ecd186767a8a82c4b2b}


增加整数型子结点 


\begin{DoxyParams}{参数}
{\em name} & 结点名称 \\
\hline
{\em value} & 整数值 \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
成功返回true,失败返回false 
\end{DoxyReturn}
\begin{DoxyNote}{注解}
none 
\end{DoxyNote}
\hypertarget{class_xml_data_a797602366bea8aa360d66c194965c543}{\index{Xml\+Data@{Xml\+Data}!add\+Sub\+Node@{add\+Sub\+Node}}
\index{add\+Sub\+Node@{add\+Sub\+Node}!Xml\+Data@{Xml\+Data}}
\subsubsection[{add\+Sub\+Node}]{\setlength{\rightskip}{0pt plus 5cm}bool Xml\+Data\+::add\+Sub\+Node (
\begin{DoxyParamCaption}
\item[{const std\+::string \&}]{node\+Name, }
\item[{const double \&}]{value}
\end{DoxyParamCaption}
)}}\label{class_xml_data_a797602366bea8aa360d66c194965c543}


增加浮点型子结点 


\begin{DoxyParams}{参数}
{\em name} & 结点名称 \\
\hline
{\em value} & 浮点数值 \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
成功返回true,失败返回false 
\end{DoxyReturn}
\begin{DoxyNote}{注解}
none 
\end{DoxyNote}
\hypertarget{class_xml_data_a6f3dd5e677198c44e55665b1aca2200b}{\index{Xml\+Data@{Xml\+Data}!add\+Sub\+Node@{add\+Sub\+Node}}
\index{add\+Sub\+Node@{add\+Sub\+Node}!Xml\+Data@{Xml\+Data}}
\subsubsection[{add\+Sub\+Node}]{\setlength{\rightskip}{0pt plus 5cm}bool Xml\+Data\+::add\+Sub\+Node (
\begin{DoxyParamCaption}
\item[{const std\+::string \&}]{node\+Name, }
\item[{const std\+::string}]{value = {\ttfamily \char`\"{}\char`\"{}}}
\end{DoxyParamCaption}
)}}\label{class_xml_data_a6f3dd5e677198c44e55665b1aca2200b}


增加字符串型子结点 


\begin{DoxyParams}{参数}
{\em name} & 结点名称 \\
\hline
{\em value} & 字符串值 \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
成功返回true,失败返回false 
\end{DoxyReturn}
\begin{DoxyNote}{注解}
none 
\end{DoxyNote}
\hypertarget{class_xml_data_a257fec6d724f2eca7b6357d528144b35}{\index{Xml\+Data@{Xml\+Data}!init\+With\+Content\+Of\+File@{init\+With\+Content\+Of\+File}}
\index{init\+With\+Content\+Of\+File@{init\+With\+Content\+Of\+File}!Xml\+Data@{Xml\+Data}}
\subsubsection[{init\+With\+Content\+Of\+File}]{\setlength{\rightskip}{0pt plus 5cm}bool Xml\+Data\+::init\+With\+Content\+Of\+File (
\begin{DoxyParamCaption}
\item[{const std\+::string \&}]{file\+Name}
\end{DoxyParamCaption}
)}}\label{class_xml_data_a257fec6d724f2eca7b6357d528144b35}


读取\+X\+M\+L文件内容进行初始化 


\begin{DoxyParams}{参数}
{\em none} & \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
成功返回true,失败返回false 
\end{DoxyReturn}
\begin{DoxyNote}{注解}
none 
\end{DoxyNote}
\hypertarget{class_xml_data_a6917a040669cf9c048eedcf27ee20f7c}{\index{Xml\+Data@{Xml\+Data}!init\+With\+Data\+String@{init\+With\+Data\+String}}
\index{init\+With\+Data\+String@{init\+With\+Data\+String}!Xml\+Data@{Xml\+Data}}
\subsubsection[{init\+With\+Data\+String}]{\setlength{\rightskip}{0pt plus 5cm}bool Xml\+Data\+::init\+With\+Data\+String (
\begin{DoxyParamCaption}
\item[{const std\+::string \&}]{content}
\end{DoxyParamCaption}
)}}\label{class_xml_data_a6917a040669cf9c048eedcf27ee20f7c}


读取\+X\+M\+L字符串进行初始化 


\begin{DoxyParams}{参数}
{\em none} & \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
成功返回true,失败返回false 
\end{DoxyReturn}
\begin{DoxyNote}{注解}
none 
\end{DoxyNote}
\hypertarget{class_xml_data_a116459823c48877fc8263723d320e7f1}{\index{Xml\+Data@{Xml\+Data}!operator\mbox{[}$\,$\mbox{]}@{operator[]}}
\index{operator\mbox{[}$\,$\mbox{]}@{operator[]}!Xml\+Data@{Xml\+Data}}
\subsubsection[{operator[]}]{\setlength{\rightskip}{0pt plus 5cm}{\bf Xml\+Node} Xml\+Data\+::operator\mbox{[}$\,$\mbox{]} (
\begin{DoxyParamCaption}
\item[{std\+::string}]{name}
\end{DoxyParamCaption}
)}}\label{class_xml_data_a116459823c48877fc8263723d320e7f1}


根据名称获取子结点 


\begin{DoxyParams}{参数}
{\em name} & 结点名称 \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
如果存在则返回第一个子结点;否则返回空结点 
\end{DoxyReturn}
\begin{DoxyNote}{注解}
none 
\end{DoxyNote}
\hypertarget{class_xml_data_a463079e4851be2d59a30ab83b8f85710}{\index{Xml\+Data@{Xml\+Data}!save\+As\+File@{save\+As\+File}}
\index{save\+As\+File@{save\+As\+File}!Xml\+Data@{Xml\+Data}}
\subsubsection[{save\+As\+File}]{\setlength{\rightskip}{0pt plus 5cm}bool Xml\+Data\+::save\+As\+File (
\begin{DoxyParamCaption}
\item[{const std\+::string \&}]{file\+Name}
\end{DoxyParamCaption}
)}}\label{class_xml_data_a463079e4851be2d59a30ab83b8f85710}


写入\+J\+S\+O\+N数据到文件中 


\begin{DoxyParams}{参数}
{\em none} & \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
成功返回true,失败返回false 
\end{DoxyReturn}
\begin{DoxyNote}{注解}
none 
\end{DoxyNote}
\hypertarget{class_xml_data_aaccbe1677c6cfc0b0cfa57d7227db266}{\index{Xml\+Data@{Xml\+Data}!serialize@{serialize}}
\index{serialize@{serialize}!Xml\+Data@{Xml\+Data}}
\subsubsection[{serialize}]{\setlength{\rightskip}{0pt plus 5cm}std\+::string Xml\+Data\+::serialize (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{class_xml_data_aaccbe1677c6cfc0b0cfa57d7227db266}


串行化\+Xml\+Data成字符串 


\begin{DoxyParams}{参数}
{\em none} & \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
成功返回xml字符串,失败返回空字符串 
\end{DoxyReturn}
\begin{DoxyNote}{注解}
none 
\end{DoxyNote}


该类的文档由以下文件生成\+:\begin{DoxyCompactItemize}
\item 
libemb/inc/\hyperlink{_xml_data_8h}{Xml\+Data.\+h}\item 
libemb/src/Xml\+Data.\+cpp\end{DoxyCompactItemize}
